Skip to main content

Replace Text

AutomatR.Word.Activities.ReplaceText

The "Replace Text" activity in AutomatR is part of the Word activities package, allowing you to replace all instances of specific text in a Word document with another specified text. This activity is designed to facilitate dynamic text replacement during automation workflows.

Properties

NameDescription
Input
Search ForSpecifies the text to be searched for and replaced. String variables containing the text to search for.
Replace WithSpecifies the text to replace the searched text. String variables containing the replacement text.
Replace AllIf checked, replaces all occurrences of the searched text with the replacement text. Boolean variables containing the flag for replacing all occurrences.
Misc
Display NameProvides a customizable name for the activity displayed in the workflow. Enhances clarity and organization within the automation project. String variables containing the desired display name.
Optional
DelaySpecifies the amount of time (in seconds) to wait before executing the "Replace Text" activity. Useful for handling synchronization issues. Integer variables containing the delay duration. Example: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1.

How to use:

  1. Drag and drop the "Replace Text" activity onto the workflow.
  2. Configure the properties by specifying the text to search for, the replacement text, and whether to replace all occurrences.
  3. Optionally, configure the delay before executing the activity.
  4. Execute the workflow to replace the specified text in the Word document.

Example:

Consider an example where the "Replace Text" activity is used to replace the occurrences of the text "OldCompanyName" with "NewCompanyName" in a Word document:

Replace Text:
Search For: "OldCompanyName"
Replace With: "NewCompanyName"
Replace All: true

In this example, the activity searches for all occurrences of "OldCompanyName" in the Word document and replaces them with "NewCompanyName". The "Replace All" option is set to true to replace all occurrences.